package us.norepeter.processing.textmatcher;

public class Comparison implements Comparable<Comparison>{

	private Entity e1;
	private Entity e2;
	private int score;

	public Comparison(Entity e1, Entity e2, int score) {
		this.e1 = e1;
		this.e2 = e2;
		this.score = score;
	}

	public Entity getE1() {
		return e1;
	}

	public Entity getE2() {
		return e2;
	}

	public int getScore() {
		return score;
	}
	
	public void addToScore( int amountToAdd ) {
		this.score += amountToAdd;
	}

	@Override
	public int compareTo(Comparison o) {
		int theirScore = o.getScore();
		int myScore = this.score;
		// my score is closer 
		if( myScore > theirScore ) return -1;
		// their score is closer
		if( myScore < theirScore ) return 1;
		// we have the same closeness
		return 0;
	}

}
